package com.dtf.admin.manage.controller;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dtf.admin.common.utils.MapUtils;
import com.dtf.admin.manage.service.SysStaffBo;
import com.dtf.admin.manage.vo.SysStaff;
import com.github.pagehelper.PageInfo;

@RequestMapping(value="/SysStaff")
@RestController
public class SysStaffController {
	
	Log log = LogFactory.getLog(SysStaffController.class);
	
	@Reference(version = "1.0.0")
	private SysStaffBo sysStaffBo;
	
	@RequestMapping(value="/querySysStaff")
	public PageInfo querySysStaff(@RequestParam Map<String, Object> params) {
		log.info(params);
		return sysStaffBo.querySysStaff(MapUtils.getInt(params, "pageNum"), MapUtils.getInt(params, "pageSize"));
	}
	@RequestMapping(value="/findSysStaffVo/{staff_id}")
	public SysStaff findSysStaffVo(@PathVariable String staff_id){
		Map param = new HashMap();
		param.put("staff_id", staff_id);
		return sysStaffBo.findSysStaffVo(param);
	}
	
	@RequestMapping(value="/findSysStaffMap/{staff_id}")
	public Map findSysStaffMap(@PathVariable String staff_id){
		Map param = new HashMap();
		param.put("staff_id", staff_id);
		return sysStaffBo.findSysStaffMap(param);
	}
	
	@RequestMapping(value="/updateSysStaffName/{staff_id}/{staff_name}")
	public Map updateSysStaffName(@PathVariable String staff_id,@PathVariable String staff_name){
		Map param = new HashMap();
		param.put("staff_id", staff_id);
		param.put("staff_name", staff_name);
		return sysStaffBo.updateSysStaffName(param);
	}
	
}
